package com.xmall.product.define.request.spu;

import com.xmall.validate.group.AddGroup;
import com.xmall.validate.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 返回数据格式：product - sku_attr
 */
@Data
public class SkuAttrRequest implements Serializable {

    /**
     * 商品spuId
     */
    private Long spuId;

    /**
     * 商品skuId
     */
    private Long skuId;

    /**
     * 属性ID
     */
    private Long attrId;

    /**
     * 属性值
     */
    @NotBlank(message = "属性值不能为空", groups = { AddGroup.class, UpdateGroup.class })
    @Size(max = 200, message = "属性值长度必须小于200", groups = { AddGroup.class, UpdateGroup.class })
    private String attrValue;

    /**
     * 可选项编号
     */
    @NotNull(message = "可选项编号不能为空", groups = { AddGroup.class, UpdateGroup.class })
    private Long attrOptionSn;
}
